import { nanoid } from "nanoid";
import {lazy } from 'react'
import App from "../App"
import CityUI from "../components/City/CityUI"
import SearchUI from "../components/Search/SearchUI"
import ComRecordUI from "../views/ComRecord/ComRecordUI";
import HisUI from "../views/History/HisUI";
import MovieDesUI from "../views/MovieDes/MovieDesUI";
import VdoPlay from "../views/VdoPlay/VdoPlay";
import WishUI from "../views/Wish/WishUI";



const routes = [
    {
        path:'/app',
        name:'app',
        key:nanoid(),
        component:App,
        children:[
            {
                path:'/app/movie',
                name:'movie',
                key:nanoid(),
                component:lazy(()=>import('../views/Movie/Movie')),
                
            },
            {
                path:'/app/video',
                name:'video',
                key:nanoid(),
                component:lazy(()=>import('../views/Video/Video')),
                
            },
            {
                path:'/app/login',
                name:'login',
                key:nanoid(),
                component:lazy(()=>import('../views/Login/LoginUI')),
                
            },
            {
                path:'/app/my',
                name:'my',
                key:nanoid(),
                component:lazy(()=>import('../views/My/MyUI')),
                auth:true
            },
        ]
    },
    {
        path:'/city',
        name:'city',
        key:nanoid(),
        component:CityUI,
        
    },
    {
        path:'/search',
        name:'search',
        key:nanoid(),
        component:SearchUI,
        
    },
    {
        path:'/moviedes/:movieId/:like',
        name:'moviedes',
        key:nanoid(),
        component:MovieDesUI,
        
    },
    {
        path:'/history',
        name:'history',
        key:nanoid(),
        component:HisUI,
        
    },
    {
        path:'/wish',
        name:'wish',
        key:nanoid(),
        component:WishUI,
        
    },
    {
        path:'/comrecord',
        name:'comrecord',
        key:nanoid(),
        component:ComRecordUI,
        
    },
    {
        path:'/vdoplay/:movieId',
        name:'vdoplay',
        key:nanoid(),
        component:VdoPlay,
        
    },
]
export default routes